package com.hsgene.user.constants;

/**
 * 浏览历史统计类型
 *
 * @author wangbing
 * @version 1.0, 2018/8/31
 */
public enum BrowseHistoryStatisticsType {

    GOODS_HITS("goods_hits", "商品浏览量"),

    GOODS_USER("goods_user", "商品独立用户浏览量"),

    UNDEFINED("undefined", "未定义的统计类型");

    private final String value;

    private final String desc;

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    BrowseHistoryStatisticsType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static BrowseHistoryStatisticsType getEnum(String value) {
        for (BrowseHistoryStatisticsType type : values()) {
            if (type.getValue().equalsIgnoreCase(value)) {
                return type;
            }
        }

        return BrowseHistoryStatisticsType.UNDEFINED;
    }
}
